<?php
/**
 * Created by PhpStorm.
 * User: dapeng
 * Date: 2019-12-05
 * Time: 09:09
 */




//var_dump($_POST);


//从post里面取值
if (isset($_POST['user'])){
    $user = $_POST['user'];//关联数组取值
}else{
    $user = "";
}

$pass = isset($_POST['pass'])? $_POST['pass'] : "";//关联数组取值


if (empty($user)){
//    echo "用户名是空的";
}

echo $user;
//删除user 变量
unset($user);
//echo $user;//这里会报错，因为已经被删除了变量

$_POST['user'] = "张三";
$_POST['age'] = 18;

var_dump($_POST);
unset($_POST['age']);//删除数组中指定元素
var_dump($_POST);//age被删除





//$cookie = $_COOKIE;
//$_COOKIE['a'] = 1;
//var_dump($cookie);
//设置了Cookie信息，浏览器可以通过它进行辨别
//setcookie("user","zhangsan张三");

//var_dump($_COOKIE);
//索引数组
//关联数组
//多维数组
//session_start();
//echo $_SESSION['user'];//张三
